package com.exam.qc.model;

import java.io.Serializable;

//响应信息类
public class ReturnVo implements Serializable {
    private Integer code;
    private String msg;
    private Object data;

    public ReturnVo() {
    }

    public ReturnVo(Integer code,String msg,Object data) {
        this.setCode(code);
        this.setMsg(msg);
        this.setData(data);
    }

    public Integer getCode() {
        return code;
    }

    public void setCode(Integer code) {
        this.code = code;
    }

    public String getMsg() {
        return msg;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }

    public Object getData() {
        return data;
    }

    public void setData(Object data) {
        this.data = data;
    }

    public static ReturnVo success(Object data){
        return new ReturnVo(200,"success",data);
    }

    public static ReturnVo success(String msg){
        return new ReturnVo(200,msg,null);
    }

    public static ReturnVo error(String msg){
        return new ReturnVo(500,msg,null);
    }

    public static ReturnVo fail(Integer code,String msg){
        return new ReturnVo(code,msg,null);
    }
}
